package com.yl.rabbitmq.day10;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.DeliverCallback;
import com.yl.rabbitmq.utils.RabbitMQUtil;

/**
 * @author yangl
 */
public class Consumer02 {
    private static final String DEAD_QUEUE = "dead_queue02";

    public static void main(String[] args) throws Exception{
        Channel channel = RabbitMQUtil.getChannel();
        System.out.println("等待接收消息......");
        DeliverCallback deliverCallback = (consumerTag, message) -> {
            System.out.println("consumer02接收的消息是：" + new String(message.getBody(), "UTF-8"));
        };
        channel.basicConsume(DEAD_QUEUE, true, deliverCallback,consumerTag->{});
    }
}
